package com.ehome.poct.backend.controller.checkstrip;

import com.ehome.core.page.PageInfo;
import com.ehome.poct.core.api.dto.CheckStripQry;
import com.ehome.poct.core.api.dto.check.TestStripPriceUpdateDTO;
import com.ehome.poct.core.api.dto.check.gold.TestStripPriceVO;
import com.ehome.poct.core.api.feign.CheckStripClient;
import com.ehome.poct.core.api.vo.check.PoctTypeVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Slf4j
@Api(tags = "检测类型信息")
@RestController
@RequestMapping("/stripinfo")
public class StripInfoController {

    @Autowired
    private CheckStripClient checkStripClient;


    @ApiOperation("检测项目")
    @GetMapping("/getstriplist/{type}")
    public List<PoctTypeVO> striplist(@PathVariable @ApiParam("0：所有检测类型；1：金标仪检测类型；2：血常规检测类型；3：联机检测类型") Integer type){ return checkStripClient.jbyCheckInfo(type); }
    @ApiOperation("检测原价列表")
    @PostMapping("/getlist")
    public PageInfo<TestStripPriceVO> list(@RequestBody  CheckStripQry qry){
        return checkStripClient.getList(qry);
    }
    @ApiOperation("启用/禁用 原价显示")
    @PutMapping("/jcstripinfo/disable/{conftypeid}")
    public  Boolean disablePirce(@PathVariable Long conftypeid){return checkStripClient.disablePrice(conftypeid);}
    @ApiOperation("修改价格")
    @PostMapping("/jcstripinfo/modify")
    public boolean updatePirce(@RequestBody TestStripPriceUpdateDTO vo){return checkStripClient.updatePrice(vo);}
}
